package com.copro.chemdb.stat.rule;

import java.util.Iterator;
import java.util.List;

import org.apache.struts.action.ActionMapping;

import com.copro.chemdb.stat.StatResult;

public class AccumulateStatResult extends StatResult {

	public AccumulateStatResult(String forwardName, Object result) {
		super(forwardName, result);
	}

	public void formatNameToPath(ActionMapping mapping) {
		Iterator<?> it = ((List<?>) result).iterator();
		while (it.hasNext()) {
			StatResult re = (StatResult) it.next();
			String path = mapping.findForward(re.getForwardName()).getPath();
			re.setForwardName(path);
		}
	}

}
